#ifndef _UTILITY_H_
#define _UTILITY_H_

#ifndef SAFE_RELEASE
#define SAFE_RELEASE(p) if(p) {p->Release(); p = nullptr; }
#endif

#ifndef SAFE_DELETE
#define SAFE_DELETE(p) if(p) { delete p; p = nullptr; }
#endif

#ifndef SAFE_DELETE_ARRAY
#define SAFE_DELETE_ARRAY(p) if(p) { delete[] p; p = nullptr; }
#endif

#ifndef DXERROR
#define DXERROR(a) { OutputDebugString(a); OutputDebugString("\n"); return false; }
#endif

#endif // _UTILITY_H_